/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28463
 * Date: 2022—07—11
 * Time: 18:29
 */
public class Demo02 {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("======前序遍历=======");
        binaryTree.preOrder(binaryTree.root);
        System.out.println();
        System.out.println("=====中序遍历========");
        binaryTree.inOrder(binaryTree.root);
        System.out.println();
        System.out.println("=====后序遍历========");
        binaryTree.postOrde(binaryTree.root);
        System.out.println();
        System.out.println("节点的个数1:" + binaryTree.size(root));
        binaryTree.size2(root);
        System.out.println("节点的个数2:" + BinaryTree.sizeNode);
        System.out.println("叶子节点的个数1:" + binaryTree.getLeafNodeCount(root));
        binaryTree.getLeafNodeCount2(root);
        System.out.println("叶子节点的个数2:" + BinaryTree.leafSize);
        System.out.println("高度：" + binaryTree.getHeight(root));
        System.out.println("查找节点："+ binaryTree.find(root,'E').val);
        System.out.println("层序遍历：");
        binaryTree.levelOrder(root);
        System.out.println("是不是满二叉树：" + binaryTree.isCompleteTree(root));
    }
}
